import { defineConfig } from 'vite';
import path from 'path';
import { fileURLToPath } from 'url';
import fs from 'fs';

export default defineConfig({
  root: '.',
  publicDir: 'public',
  server: {
    port: 5174,
    open: true
  },
  build: {
    outDir: 'dist',
    assetsDir: 'assets',
    rollupOptions: {
      input: {
        main: path.resolve(__dirname, 'index.html'),
        demos: path.resolve(__dirname, 'demos.html')
      }
    }
  },
  // 配置别名，使相对路径引用正确
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  }
});